package com.sgcc.ln.pmos.e_ln_home.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class MembersMarketBean implements Serializable {

    private List<PowerCompanyTableBean> powerCompanyTable;
    private List<PowerUserTableBean> powerUserTable;
    private List<PowerUserTableBean> powerUserUp;
    private List<PowerUserTableBean> powerUserDown;
    private List<MembersMarketDetailsBean> powerCompanyDetails;
    private List<MembersMarketDetailsBean> powerUserDetails;

    public List<PowerCompanyTableBean> getPowerCompanyTableList(int pageNum, List<PowerCompanyTableBean> list) {
        List<PowerCompanyTableBean> listsort = new ArrayList<>();
        //进行分页操作
        for (int i = (pageNum > 1 ? 10 * (pageNum - 1) : 0);
             i < (pageNum * 10 > list.size() ? (pageNum * 10) - ((pageNum * 10) - list.size()) : pageNum * 10); i++) {
            listsort.add(list.get(i));
        }
        return listsort;
    }

    public List<PowerUserTableBean> getPowerUserTableList(int pageNum, List<PowerUserTableBean> list) {
        List<PowerUserTableBean> listsort = new ArrayList<>();
        //进行分页操作
        for (int i = (pageNum > 1 ? 10 * (pageNum - 1) : 0);
             i < (pageNum * 10 > list.size() ? (pageNum * 10) - ((pageNum * 10) - list.size()) : pageNum * 10); i++) {
            listsort.add(list.get(i));
        }
        return listsort;
    }

    public List<PowerUserTableBean> getPowerUserTableUPList(int pageNum) {
        List<PowerUserTableBean> listsort = new ArrayList<>();
        //进行分页操作
        for (int i = (pageNum > 1 ? 10 * (pageNum - 1) : 0);
             i < (pageNum * 10 > powerUserUp.size() ? (pageNum * 10) - ((pageNum * 10) - powerUserUp.size()) : pageNum * 10); i++) {
            listsort.add(powerUserUp.get(i));
        }
        return listsort;
    }

    public List<PowerUserTableBean> getPowerUserTableDownList(int pageNum) {
        List<PowerUserTableBean> listsort = new ArrayList<>();
        //进行分页操作
        for (int i = (pageNum > 1 ? 10 * (pageNum - 1) : 0);
             i < (pageNum * 10 > powerUserDown.size() ? (pageNum * 10) - ((pageNum * 10) - powerUserDown.size()) : pageNum * 10); i++) {
            listsort.add(powerUserDown.get(i));
        }
        return listsort;
    }

    public List<PowerUserTableBean> getPowerUserUp() {
        return powerUserUp;
    }

    public void setPowerUserUp(List<PowerUserTableBean> powerUserUp) {
        this.powerUserUp = powerUserUp;
    }

    public List<PowerUserTableBean> getPowerUserDown() {
        return powerUserDown;
    }

    public void setPowerUserDown(List<PowerUserTableBean> powerUserDown) {
        this.powerUserDown = powerUserDown;
    }

    /**
     * 找数据
     *
     * @param type 1 售电公司  2电力用户
     * @param name 公司名
     * @return
     */
    public MembersMarketDetailsBean getBean(String type, String name) {
        if ("1".equals(type)) {
            for (MembersMarketDetailsBean bean : powerCompanyDetails) {
                if (name.equals(bean.getEnterpriseName())) {
                    return bean;
                }
            }
        } else {
            for (MembersMarketDetailsBean bean : powerUserDetails) {
                if (name.equals(bean.getEnterpriseName())) {
                    return bean;
                }
            }
        }
        return null;
    }

    public List<PowerCompanyTableBean> getPowerCompanyTable() {
        return powerCompanyTable;
    }

    public void setPowerCompanyTable(List<PowerCompanyTableBean> powerCompanyTable) {
        this.powerCompanyTable = powerCompanyTable;
    }

    public List<PowerUserTableBean> getPowerUserTable() {
        return powerUserTable;
    }

    public void setPowerUserTable(List<PowerUserTableBean> powerUserTable) {
        this.powerUserTable = powerUserTable;
    }

    public List<MembersMarketDetailsBean> getPowerCompanyDetails() {
        return powerCompanyDetails;
    }

    public void setPowerCompanyDetails(List<MembersMarketDetailsBean> powerCompanyDetails) {
        this.powerCompanyDetails = powerCompanyDetails;
    }

    public List<MembersMarketDetailsBean> getPowerUserDetails() {
        return powerUserDetails;
    }

    public void setPowerUserDetails(List<MembersMarketDetailsBean> powerUserDetails) {
        this.powerUserDetails = powerUserDetails;
    }

    public static class PowerCompanyTableBean implements Serializable {
        private String powerCompany;
        private String creditRating;
        private String num;
        private String monthAvgPower;

        public String getPowerCompany() {
            return powerCompany;
        }

        public void setPowerCompany(String powerCompany) {
            this.powerCompany = powerCompany;
        }

        public String getCreditRating() {
            return creditRating;
        }

        public void setCreditRating(String creditRating) {
            this.creditRating = creditRating;
        }

        public String getNum() {
            return num;
        }

        public void setNum(String num) {
            this.num = num;
        }

        public String getMonthAvgPower() {
            return monthAvgPower;
        }

        public void setMonthAvgPower(String monthAvgPower) {
            this.monthAvgPower = monthAvgPower;
        }
    }

    public static class PowerUserTableBean implements Serializable {
        private String powerUserName;
        private String ismembers;
        private String closingDate;

        public String getPowerUserName() {
            return powerUserName;
        }

        public void setPowerUserName(String powerUserName) {
            this.powerUserName = powerUserName;
        }

        public String getIsmembers() {
            return ismembers;
        }

        public void setIsmembers(String ismembers) {
            this.ismembers = ismembers;
        }

        public String getClosingDate() {
            return closingDate;
        }

        public void setClosingDate(String closingDate) {
            this.closingDate = closingDate;
        }
    }

    public static class MembersMarketDetailsBean implements Serializable {
        private String enterpriseName;
        private String creditCode;
        private String legalPerson;
        private String owernType;
        private String registrationTime;
        private String residence;
        private String natureOfBusiness;
        private String contactInformation;

        public String getEnterpriseName() {
            return enterpriseName;
        }

        public void setEnterpriseName(String enterpriseName) {
            this.enterpriseName = enterpriseName;
        }

        public String getCreditCode() {
            return creditCode;
        }

        public void setCreditCode(String creditCode) {
            this.creditCode = creditCode;
        }

        public String getLegalPerson() {
            return legalPerson;
        }

        public void setLegalPerson(String legalPerson) {
            this.legalPerson = legalPerson;
        }

        public String getOwernType() {
            return owernType;
        }

        public void setOwernType(String owernType) {
            this.owernType = owernType;
        }

        public String getRegistrationTime() {
            return registrationTime;
        }

        public void setRegistrationTime(String registrationTime) {
            this.registrationTime = registrationTime;
        }

        public String getResidence() {
            return residence;
        }

        public void setResidence(String residence) {
            this.residence = residence;
        }

        public String getNatureOfBusiness() {
            return natureOfBusiness;
        }

        public void setNatureOfBusiness(String natureOfBusiness) {
            this.natureOfBusiness = natureOfBusiness;
        }

        public String getContactInformation() {
            return contactInformation;
        }

        public void setContactInformation(String contactInformation) {
            this.contactInformation = contactInformation;
        }
    }


}
